"""商机页面"""
from selenium.webdriver.common.by import By

from page.base_page import BasePage


class BusinessPage(BasePage):
        url="/index.php?m=business"
        #定位器
        my_business_locator = (By.LINK_TEXT, "我负责的")
        table_locator = (By.CSS_SELECTOR, "#form1 > table > tbody")
        promote_locator = (By.LINK_TEXT, "推进")
        promote_info_locator = (By.CSS_SELECTOR, "#ui-id-4")
        def my_business(self):
              #点击我负责的
             self.find_element(self.my_business_locator).click()
        def click_promote(self):
                #点击第一个商机的推进
                trs=self.driver.find_elements(*self.table_locator)
                trs[0].find_element(*self.promote_locator).click()
        def promote_info(self):
                #推进的信息
              return  self.find_element(self.promote_info_locator).text
